% understanding about fftshift
% 
clear
clc

syms x t

x_t=exp(-2*abs(t))
y_t=subs(x_t,t,t-5) % performing the time shift

T=10;
tau=0.01;
N=T/tau;
t1=[0:tau:T-tau];

x_t_s=subs(x_t,t,t1);
X=tau*fft(x_t_s);
X_shift=fftshift(X);

y_t_s=subs(y_t,t,t1);
Y=tau*fft(y_t_s);
Y_shift=fftshift(Y);

w=-(pi/tau)+(0:N-1)*(2*pi/(N*tau));

% if x_t FT is X_jw then 
% x_t_min_5=e^(-jw5)*X_jw
%Y_jw=e^(-jw5)*X_jw
%X_jw=e^(jw5)*Y_jw
X_w=exp(j*5*w).*Y_shift;

figure(1)
clf

subplot(211)
plot(w,real(X_shift));
title('real part of X shift');

subplot(212)
plot(w,real(X_w));
title('real part of X w');
